﻿using System;
using System.Configuration;

namespace AppEszköz.Config
{
    public sealed class ConfigHelper
    {
        private ConfigHelper()
        {
        }

        public static string GetConfig(string key)
        {
            return ConfigurationManager.AppSettings[key];
        }

        public static bool GetConfigBool(string key)
        {
            bool flag = false;
            string config = ConfigHelper.GetConfig(key);
            if (config != null)
            {
                if (config.Length != 0)
                {
                    try
                    {
                        flag = bool.Parse(config);
                    }
                    catch (FormatException ex)
                    {
                    }
                }
            }
            return flag;
        }
    }
}